str = "你好，中国！"
utf8_str = str.encode("utf8")
print(utf8_str, type(utf8_str))

str_uft8_encode = b'\xe4\xbd\xa0\xe5\xa5\xbd\xef\xbc\x8c\xe4\xb8\xad\xe5\x9b\xbd\xef\xbc\x81'
print(str_uft8_encode.decode("utf-8"), type(str_uft8_encode.decode("utf-8")))

gbk_str = str.encode("gbk")
print(gbk_str, type(gbk_str))

str_gbk_encode = b'\xc4\xe3\xba\xc3\xa3\xac\xd6\xd0\xb9\xfa\xa3\xa1'
print(str_gbk_encode.decode("gbk"), type(str_gbk_encode.decode("gbk")))